﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
public partial class Product : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            clsBSDungChung dungchung = new clsBSDungChung();
            DataTable dt = new DataTable();
            if (Request.QueryString["search"] != null)
            {
                this.MultiView1.ActiveViewIndex = 2;
                this.lblTitle.Text = "Kết quả tìm kiếm";
            }
            else
            {
                if (Request.QueryString["cate"] != null)
                {
                    this.MultiView1.ActiveViewIndex = 0;
                    dt = dungchung.GetDataTableSQL("select tenloai from loai where id=" + Request.QueryString["cate"], "table");
                }
                else
                {
                    if (Request.QueryString["category"] != null)
                    {
                        this.MultiView1.ActiveViewIndex = 1;
                        dt = dungchung.GetDataTableSQL("select ten from nhanhieu where id=" + Request.QueryString["category"], "table");
                    }
                    else
                    {
                        this.MultiView1.ActiveViewIndex = -1;
                    }
                }
                if (dt.Rows.Count == 1)
                {
                    this.lblTitle.Text = dt.Rows[0][0].ToString();
                }
                else
                {
                    this.lblTitle.Text = "";
                }
            }
        }
        catch
        {
        }

    }
}